package com.xtedu.examproject.service;

import com.xtedu.examproject.dao.base.ClassExamRecordDao;
import com.xtedu.examproject.dao.impl.ClassExamRecordDaoImpl;
import com.xtedu.examproject.entity.ClassExamRecord;

import java.util.List;

public class ClassExamRecordService {
    private ClassExamRecordDao classExamRecordDao;

    public ClassExamRecordService() {
        classExamRecordDao = new ClassExamRecordDaoImpl();
    }

    public int insertClassExamRecord(ClassExamRecord classExamRecord) throws Exception {
        return classExamRecordDao.insert(classExamRecord);
    }

    public int deleteClassExamRecord(ClassExamRecord classExamRecord) throws Exception {
        return classExamRecordDao.delete(classExamRecord);
    }

    public int updateClassExamRecord(ClassExamRecord classExamRecord) throws Exception {
        return classExamRecordDao.update(classExamRecord);
    }

    public ClassExamRecord findClassExamRecordById(int id) throws Exception {
        return classExamRecordDao.findById(id);
    }

    public List<ClassExamRecord> findAllClassExamRecord() throws Exception {
        return classExamRecordDao.findAll();
    }
}
